package com.sjs.boot.dynamic.http.exception;

import com.sjs.boot.dynamic.protocol.RetCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author uto_dev_008
 * @desc
 * @since 2021/11/22 15:44
 */
public class PlatformException extends AbstractApiException {
    private static final Logger logger = LoggerFactory.getLogger(PlatformException.class);
    private static final long serialVersionUID = 8929814939980921225L;

    public static final int DEFAULT_ERROR_CODE = RetCode.INTERNAL_ERROR.getCode();

    public PlatformException(String message) {
        super(message, DEFAULT_ERROR_CODE, false);
    }

    /**
     * 业务推荐使用
     *
     * @param message
     * @param code
     */
    public PlatformException(String message, int code) {
        super(message, code, false);
    }

    /**
     * 业务控制是否使用i18
     *
     * @param message
     * @param code
     */
    public PlatformException(String message, int code, boolean i18) {
        super(message, code, i18);
    }

    public PlatformException(String message, int code, Throwable throwable) {
        super(message, code, throwable, false);
    }

    public PlatformException(Object data, String message, int code) {
        super(data, message, code, false);
    }

    public PlatformException(Object data, String message, int code, Throwable throwable) {
        super(data, message, code, throwable, false);
    }
}
